Electronic locks typically have more than one memory. The typical electronic lock has a microprocessor which either has an incorporated or an associated read-only memory as well as at least one other memory, which is a non-volatile type memory for storage of data necessary to the operation of the lock. Combinations are written to or stored in and further read from the non-volatile memory, typically an Electrically Erasable Programmable Read-Only Memory (EEPROM), during lock operations. The stored data may be properly written to the memory; and, due to some subsequent event, one or more of the data bytes may become corrupted or damage may occur to the memory at the location of such stored data.
If, during the normal operation of the electronic lock, a combination is not readable from the memory or corrupted data representing an incorrect combination is read from the memory, then the lock is unopenable. Whenever the lock does not respond to a combination, the lock and/or safe typically must be drilled to gain access to the locking mechanism of the lock in order to open the container. Drilling a container and the lock thereon not only is expensive but damages the container door and the lock, thereby requiring repair or replacement of the container door and replacement of the lock at considerable inconvenience and expense.
Corrupted data may result from such events as electrostatic discharge (ESD), memory failure or any other damage which may render a particular memory location incapable of retaining the data stored therein.
Anytime data is stored in the memory of the electronic lock, the data is read from a buffer, internal to the microprocessor controlling the operations of the lock, and then under the control of the microprocessor, written into the memory along with a Cyclic Redundancy Check (CRC) byte. There is a CRC byte associated with each of the buffer entries recorded into memory.
Immediately after the data is recorded into the memory, a confirmation read operation is initiated in which the data just recorded is reread from the memory for purposes of confirming the accuracy of the information stored. The CRC byte is calculated based upon the data which is read from the memory, compared with the CRC byte stored in the previous storage cycle, and reread from the memory. If the CRC bytes and the data both compare, at this point the data is assumed to be written in correct form and further actions of the microprocessor proceed from that point. In the event that there is a discrepancy, there is an immediate rewriting of the information from the buffer into the lock microprocessor control memory and that rewritten information then is read for confirmation, as previously described.
At a later time when the lock is being operated to open the lock and the related container upon which it is installed, the data may be read from the memory. The data, typically under these circumstances, would be the stored combination which is the authorized combination. Any combination entered into the lock must compare equal to the stored or authorized combination and, therefore, the combination must be retrieved accurately from the memory.
If the calculated CRC byte and the retrieved CRC byte associated with the data read from the memory compare favorably, then the data bytes associated with the retrieved CRC byte are assumed to be correct and the electronic controls of the lock then further process that information and compare the retrieved combination with the combination entered into the lock. However, if the retrieved CRC byte and the calculated CRC byte do not compare, this no-compare condition serves as an indicator that there has been a failed read operation and the lock is incapable of proper operation. Accordingly, the lock will not open unless there is another combination for another user properly programmed into the lock. In the event that either there is no other combination which may be tried or the memory has been so thoroughly corrupted that any other combinations similarly are detected as errors, then the alternative is to drill the container and the lock to gain access to the lock mechanism and manipulate the lock mechanism in such a way as to open the container. Other data reading and writing validity checking techniques may be used. Alternative techniques include Longitudinal Redundancy Check (LRC), check sum, parity and Brown Peterson codes. Other techniques may be used if desired to verify the accuracy of data read or written from or to a memory.